package com.leadingsoft.pwxk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.converter.AuditBaseInfoConverter;
import com.leadingsoft.pwxk.dto.AuditBaseInfoDto;
import com.leadingsoft.pwxk.model.AuditBaseInfo;
import com.leadingsoft.pwxk.service.AuditBaseInfoService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
 * 
 * @author ysh
 *
 */
@Api(description = "审批信息-基本信息审核相关")
@RestController
@RequestMapping("api/auditBaseInfo")
public class AuditBaseInfoController {

	@Autowired
	AuditBaseInfoService auditBaseInfoService;

	@Autowired
	AuditBaseInfoConverter auditBaseInfoConverter;

	@ApiOperation("审批信息-基本信息审核信息")
	@GetMapping(path =  "{dataid}" )
	@ResponseStatus(code = HttpStatus.OK)
	public AuditBaseInfoDto get(@PathVariable(value = "dataid") String dataId) {
		AuditBaseInfo AuditBaseInfo = auditBaseInfoService.getByDataId(dataId).get(0);
		return auditBaseInfoConverter.toDto(AuditBaseInfo);
	}

}
